<template>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        商品管理
        <small>管理您仓库中的商品</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-archive"></i> 商品管理</a></li>
        <li class="active">商品详情</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">

          <div class="box" style="background: #efefef">
            <div class="box-header">
              <h3 class="box-title">商品总览</h3>
              <router-link to="/main/addProduct">
                <button class="btn btn-success pull-right" type="button">添加商品</button>
              </router-link>
            </div>
            <section class="content">
              <div class="row">
                <div class="col-xs-12">

                  <div v-for="product in productList" :key="product.id" class="box box-default"
                       style="border-radius: 15px;position: relative">
                    <img alt="1" src="../../../public/img/boxicon.png"
                         style="width: 60px;margin-left: 10px;margin-top: 10px;border-radius: 5px"/>
                    <span style="margin-left: 10px;font-size: large;font-weight: bold">商品id：{{ product.id }}</span>
                    <span style="position: absolute;left: 80px;top: 50px">商品名：{{ product.name }}</span>
                    <span style="position: absolute;left: 220px;top: 50px">库存总量：{{ product.count }}</span>
                    <span style="position: absolute;left: 220px;top: 80px">可售总量：{{ product.unsell }}</span>
                    <div style="margin-left: 80px;margin-top: 10px">价格：{{ product.price }}</div>
                    <div>&nbsp;</div>
                    <div style="float: right">
                      <router-link :to="'/main/changeProduct/'+product.index">
                        <button class="btn btn-primary" style="position: absolute;margin-left: -20vw;margin-top: -110px"
                                type="button">修改
                        </button>
                      </router-link>
                    </div>

                  </div>

                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </section>

          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
</template>

<script>
export default {
  name: "ProductManager",
  data() {
    return {
      productList: this.GLOBAL.appData.productList
    }
  }
}
</script>

<style scoped>

</style>
